Skip to content

Cancel stale On PR runs via concurrency group#775

Merged
rdimitrov merged 1 commit intomainfrom
oncPR-concurrency-cancel-stale
Apr 21, 2026
Merged

Cancel stale On PR runs via concurrency group#775
rdimitrov merged 1 commit intomainfrom
oncPR-concurrency-cancel-stale

Conversation

@rdimitrov
Copy link
Copy Markdown
Member

Context

On PR #759, after the upstream-release-docs workflow pushed the skill's generation commit, the `On PR` workflow's Lint and format checks job ran against that still-unformatted commit and reported FAILURE. A later step in the same upstream workflow ran prettier/eslint and pushed a fixup commit, triggering a new `On PR` run that succeeded — but the earlier FAILURE lingered in the check history.

The race is unavoidable on our side: `claude-code-action@v1` auto-commits AND auto-pushes with no configurable way to disable either, so intermediate commits always hit the branch before the autofix step can run.

Fix

Add a concurrency group on `on-pr.yaml`:

```yaml
concurrency:
group: on-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
```

When the autofix commit lands, the in-flight `On PR` run on the skill commit cancels. Only the final run determines check status. This is standard GitHub Actions practice for PR CI — rapid-fire commits (humans pushing fixups, or our skill pipeline) don't tie up runner minutes on stale results.

Keyed on `pull_request.number` so PRs can't cancel each other's runs.

Doesn't affect

  • Required-check evaluation: GitHub evaluates required checks against the PR's HEAD. As long as the final commit's `On PR` run succeeds, the PR is mergeable.
  • Branch protection: no changes.
  • Non-upstream PRs: they get the same benefit — if a human pushes a rapid fixup, the stale run cancels. Strict improvement.

Adds a concurrency group on the On PR workflow with
cancel-in-progress: true.

Context: the upstream-release-docs workflow pushes multiple
commits in quick succession to a Renovate PR branch — the skill's
content commit, then a prettier/eslint autofix commit that cleans
any formatting drift the skill introduced. Without concurrency,
the On PR workflow runs fully on each intermediate commit and the
first one (pre-autofix) can fail lint. The failure lingers in the
check history even though the final commit passes.

With cancel-in-progress, when the autofix commit lands, the stale
On PR run on the skill commit is cancelled. Only the final run
determines the check status. Matches standard GitHub Actions
practice for PR CI.

Concurrency group is keyed on pull_request.number so PRs can't
cancel each other's runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 22:58
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment Apr 21, 2026 10:58pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds workflow-level concurrency to the On PR GitHub Actions workflow so that when multiple commits land in quick succession on the same PR, older in-flight runs are automatically cancelled and only the latest run’s result is reflected in checks.

Changes:

  • Introduces a concurrency group keyed by pull_request.number for the On PR workflow.
  • Enables cancel-in-progress to stop stale CI runs when a newer commit triggers a new run.
  • Documents the rationale inline in the workflow file.

@rdimitrov rdimitrov enabled auto-merge (squash) April 21, 2026 22:59
@rdimitrov rdimitrov merged commit d09f914 into main Apr 21, 2026
7 checks passed
@rdimitrov rdimitrov deleted the oncPR-concurrency-cancel-stale branch April 21, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants